const express = require('express');
const router = express.Router();
const multer = require('multer');
const booksController = require('../controller/BooksController');

// 定义上传的目录
let upload = multer({ dest: 'uploads/' });

router.get('/getPage', booksController.getPage);
router.delete('/delBook/:id', booksController.delBook);

router.get('/search', booksController.search);
router.get('/getAllType', booksController.getAllType);
router.post('/addBook', booksController.addBook);

router.get('/getOneBook', booksController.getOneBook);
router.put('/editOneBook/:id', booksController.editOneBook);

module.exports = router;
